#!/usr/bin/python
# -*- coding: UTF-8 -*-  

"ChainCall"

__author__ = "Wang Zhe"

class Chain(object):
    """docstring for Chain"""
    def __init__(self,*,split = '.' ,path = ''):
        super(Chain, self).__init__()
        self._path = path
        self._split = split

    def __getattr__(self,path):
        # return Chain(path = '%s%s%s' % (self._path,self._split,path))
        self._path = "%s%s%s" % (self._path,self._split,path)
        return  self

    def __call__(self,path):
        return self.__getattr__(path)

    def __str__(self):
        return self._path


    __repr__ = __str__

def main():
    print(Chain(split = '/').users(':michael').repos)
    print(Chain(path = 'https://www').hao123.com)

if __name__ == '__main__':
    main()